<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$user_czqx=$user_class->user_qx('','',$user_uid);
$act=$_GET['act'];
if($act =='ok'){
   $fid=$_GET['fid'];
   $mm =$_GET['mm'];
   if(!$user_uid){
	    echo'1';
   }elseif(!$mm ){
   	  echo'2';
   }else if(!$db->get_one('plugin_liaotian_class'," `id` ='$fid'",'')){
   	  echo'2';
   }else if($db->get_one('plugin_liaotian_xhw',"`type` ='1' and `lid` ='$fid' and `uid` ='$user_uid' ",'') && !$user_czqx){
   	  echo'4';
   }else if($db->insert('plugin_liaotian','`id` ,`lid`,`uid` ,`type`,`name_ys` ,`content` ,`time_a`',"NULL , '$fid', '$user_uid', '0','000000', '$mm', '$time'" )){
   	        $db->update('plugin_liaotian_class',"`lsid` =`lsid`+1"," `id` ='$fid'");
   	  echo'5';
   }else{
   	  echo'6';
   }
}elseif($act =='nr'){
	 preg_match("/fid=([0-9]{1,9})/",$url_a,$link);
	 $fid=$link[1];
	 $qpid=$_COOKIE['liaotianqp-'.$fid];
	 $ltgg=$db->get_one('plugin_liaotian'," `lid` ='$fid' and `id` > '$qpid' ORDER BY `id` DESC LIMIT 0,1",'');
	 setcookie('liaotian-'.$fid,$ltgg[id]);
	 if($ltgg[id]){
   echo'<div class="usersms">';
   $sql_bbs  =$db->query('plugin_liaotian'," `lid` ='$fid' and `id` > '$qpid' ORDER BY `id` DESC LIMIT 0 , 20 ",'');
   while($row_b=mysql_fetch_array($sql_bbs)){
       $hyname='';
       $hynamej=$user_class->user_name($row_b[uid],'1');
       $hytx  =$user_class->user_tx($row_b['uid']);
       $content=$ubb->content_ubb($row_b[content]);
       $tsj=Bingz_time($row_b['time_a']);
          if($row_b[uid] == $user_uid){
             echo'<div class="forum_con">';
          }elseif ($vaa[type] == '1'){
             echo'<div class="forum_conyx">';
          }else{
             echo'<div class="forum_cony">';
          }
           echo'<dt><a href="index.php?'.$Bingz_ml.'=user&uid='.$row_b[uid].'"><img src="'.$hytx.'" alt="'.$hyname.'" /></a></dt>
              <dd> 
              <hb>'.$content.'</a>
              <div class="y">'.$tsj.'<b><b>'.$hyname.'</b></b></div></hb>
              </dd>
          </div>';
   }
   echo'</div>';
   }
}elseif($act =='hq'){
	    $fid=$_COOKIE['liaotianqp'];
	    $lt=$db->get_one('plugin_liaotian'," `id` ='$fid'",'');
	    $ltgg=$db->get_one('plugin_liaotian'," `lid` ='$lt[lid]' ORDER BY `id` DESC LIMIT 0,1",'');
	    if($ltgg[id] > $fid ){
	       echo'1';
	    }
}elseif($act =='qp'){
	 preg_match("/fid=([0-9]{1,9})/",$url_a,$link);
	 $fid=$link[1];
	    $liaotianqpmd='liaotian-'.$fid;
	    setcookie('liaotianqp-'.$fid.'',$_COOKIE[$liaotianqpmd]);
	    echo'1';
}
$templateshead='1';
$templatesfoot='1';
?>